fix(docker): apply host networking via compose override in dockerw - #257
Open
cleithner-comcast wants to merge 4 commits into
Open
fix(docker): apply host networking via compose override in dockerw#257cleithner-comcast wants to merge 4 commits into
cleithner-comcast wants to merge 4 commits into
Conversation
The dockerw -H flag passed "--network host" to "docker compose run", but that flag only exists for "docker run"; "docker compose run" rejects it with an unknown-flag error. Apply host networking by layering the existing docker/compose.host-network.yaml override instead, matching the devcontainer mechanism.
cleithner-comcast
requested review from
kfundecmcsa,
mkkoch,
rchowdcmcsa and
tleacmcsa
as code owners
August 4, 2026 14:00
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes dockerw -H host-networking behavior by switching from an invalid docker compose run --network host flag (unsupported by docker compose run) to layering the existing docker/compose.host-network.yaml override, aligning with the devcontainer approach.
Changes:
- Replace
--network hostflag usage with a host-network compose override file when-His provided. - Refactor compose invocation to support multiple
-ffiles (base + optional override).
Suppressed comments (1)
dockerw:84
- With
COMPOSE_FILESas an array, pass it as"${COMPOSE_FILES[@]}"so each-fand its path remain separate arguments even when the working directory contains spaces.
docker compose ${COMPOSE_FILES} run \
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (1)
dockerw:84
COMPOSE_FILESis a bash array, but${COMPOSE_FILES}expands to only the first element (${COMPOSE_FILES[0]}), so the compose file paths are not passed and the command will fail/misbehave. Expand the full array with"${COMPOSE_FILES[@]}".
docker compose ${COMPOSE_FILES} run \
tleacmcsa
previously approved these changes
Aug 4, 2026
COMPOSE_FILES was assigned as a bash array but referenced with scalar
${COMPOSE_FILES}, which expands to only the first element (-f). That turned
the invocation into "docker compose -f run ...", where -f consumed "run" as
the compose-file path and "--rm" was parsed as a top-level flag, failing with
"unknown flag: --rm". Expand with "${COMPOSE_FILES[@]}" instead.
tleacmcsa
approved these changes
Aug 4, 2026
rchowdcmcsa
approved these changes
Aug 5, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
Suppressed comments (1)
dockerw:72
- If this script runs with
set -u/nounset, referencing an unsetHOST_NETWORKwill error. Prefer using a default expansion in the test (e.g., check${HOST_NETWORK:-}) or initializeHOST_NETWORKto an empty value before option parsing.
if [ -n "$HOST_NETWORK" ]; then
COMPOSE_FILES+=(-f "${DIR}/docker/compose.host-network.yaml")
fi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The dockerw -H flag passed "--network host" to "docker compose run", but that flag only exists for "docker run"; "docker compose run" rejects it with an unknown-flag error. Apply host networking by layering the existing docker/compose.host-network.yaml override instead, matching the devcontainer mechanism.